package com.cms.controller;

import fun.zhaofan.cms.util.baseObject.BaseController;
import com.cms.model.User;
import com.cms.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zf
 * @since 2021-03-13
 */
@Api(value="用户信息")
@Slf4j
@RestController
@RequestMapping("user")
public class UserController extends BaseController {
    @Autowired
    private UserService userService;


//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long"),
//            @ApiImplicitParam(name = "user", value = "用户详细实体user", required = true, dataType = "User")
//    })
    @ApiOperation(value="分页查询",notes = "接口描述")
    @ApiImplicitParam(name = "Page<User>", value = "分页查询参数", required = false, dataType = "Page")
    @PostMapping("/findByPage")
    public Page<User> findByPage(@RequestBody Page<User> page) {
        return userService.page(page);
    }

}
